package com.homework.papertexting.repository;

import com.homework.papertexting.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepository extends JpaRepository<User, Long> {

    Optional<User> findByUsername(String username);

    Optional<User> findByEmail(String email); // 添加这个方法声明

    boolean existsByUsername(String username);

    boolean existsByEmail(String email);
}